return FALSE;
g_autofree char *kernel_cmdline = read_proc_cmdline ();
- g_autoptr (ComposefsConfig) composefs_config
- = otcore_load_composefs_config (kernel_cmdline, config, TRUE, error);
+ g_autoptr (RootConfig) composefs_config
+ = otcore_load_rootfs_config (kernel_cmdline, config, TRUE, error);
if (!composefs_config)
return FALSE;
// out if it's enabled, but not supported at compile time.
// However, we don't load the keys here, because they may not exist, such
// as in the initial deploy
- g_autoptr (ComposefsConfig) composefs_config
- = otcore_load_composefs_config ("", prepare_root_config, FALSE, error);
+ g_autoptr (RootConfig) composefs_config
+ = otcore_load_rootfs_config ("", prepare_root_config, FALSE, error);
if (!composefs_config)
return glnx_prefix_error (error, "Reading composefs config");
}
void
-otcore_free_composefs_config (ComposefsConfig *config)
+otcore_free_rootfs_config (RootConfig *config)
{
g_clear_pointer (&config->pubkeys, g_ptr_array_unref);
g_free (config->signature_pubkey);
g_free (config);
}
-// Parse the [composefs] section of the prepare-root.conf.
-ComposefsConfig *
-otcore_load_composefs_config (const char *cmdline, GKeyFile *config, gboolean load_keys,
- GError **error)
+// Parse key bits of prepare-root.conf into a data structure.
+RootConfig *
+otcore_load_rootfs_config (const char *cmdline, GKeyFile *config, gboolean load_keys,
+ GError **error)
{
g_assert (cmdline);
g_assert (config);
- GLNX_AUTO_PREFIX_ERROR ("Loading composefs config", error);
+ GLNX_AUTO_PREFIX_ERROR ("Parsing rootfs config", error);
- g_autoptr (ComposefsConfig) ret = g_new0 (ComposefsConfig, 1);
+ g_autoptr (RootConfig) ret = g_new0 (RootConfig, 1);
g_autofree char *enabled = g_key_file_get_value (config, OTCORE_PREPARE_ROOT_COMPOSEFS_KEY,
OTCORE_PREPARE_ROOT_ENABLED_KEY, NULL);
}
gboolean
-otcore_mount_rootfs (ComposefsConfig *composefs_config, GVariantBuilder *metadata_builder,
+otcore_mount_rootfs (RootConfig *composefs_config, GVariantBuilder *metadata_builder,
gboolean root_transient, const char *root_mountpoint, const char *deploy_path,
const char *mount_target, bool *out_using_composefs, GError **error)
{
gboolean is_signed;
char *signature_pubkey;
GPtrArray *pubkeys;
-} ComposefsConfig;
-void otcore_free_composefs_config (ComposefsConfig *config);
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (ComposefsConfig, otcore_free_composefs_config)
+} RootConfig;
+void otcore_free_rootfs_config (RootConfig *config);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (RootConfig, otcore_free_rootfs_config)
-ComposefsConfig *otcore_load_composefs_config (const char *cmdline, GKeyFile *config,
- gboolean load_keys, GError **error);
+RootConfig *otcore_load_rootfs_config (const char *cmdline, GKeyFile *config, gboolean load_keys,
+ GError **error);
/**
* otcore_mount_rootfs:
*
* Returns: %TRUE on success, %FALSE on error.
*/
-gboolean otcore_mount_rootfs (ComposefsConfig *composefs_config, GVariantBuilder *metadata_builder,
+gboolean otcore_mount_rootfs (RootConfig *composefs_config, GVariantBuilder *metadata_builder,
gboolean root_transient, const char *root_mountpoint,
const char *deploy_path, const char *mount_target,
bool *out_using_composefs, GError **error);
// We always parse the composefs config, because we want to detect and error
// out if it's enabled, but not supported at compile time.
- g_autoptr (ComposefsConfig) composefs_config
- = otcore_load_composefs_config (kernel_cmdline, config, TRUE, &error);
+ g_autoptr (RootConfig) composefs_config
+ = otcore_load_rootfs_config (kernel_cmdline, config, TRUE, &error);
if (!composefs_config)
errx (EXIT_FAILURE, "%s", error->message);